<?php

/**
 * Personal form base class.
 *
 * @method Personal getObject() Returns the current form's model object
 *
 * @package    reducars
 * @subpackage form
 * @author     victor
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasePersonalForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_personal'     => new sfWidgetFormInputHidden(),
      'pers_nombre'     => new sfWidgetFormInputText(),
      'pers_apellidos'  => new sfWidgetFormInputText(),
      'pers_rut'        => new sfWidgetFormInputText(),
      'pers_correo'     => new sfWidgetFormInputText(),
      'pers_direccion'  => new sfWidgetFormInputText(),
      'pers_fono_fijo'  => new sfWidgetFormInputText(),
      'pers_fono_movil' => new sfWidgetFormInputText(),
      'pers_user'       => new sfWidgetFormInputText(),
      'pers_pass'       => new sfWidgetFormInputText(),
      'pers_fech_ingre' => new sfWidgetFormDate(),
      'pers_habilitado' => new sfWidgetFormInputText(),
      'pers_tipo'       => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id_personal'     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_personal')), 'empty_value' => $this->getObject()->get('id_personal'), 'required' => false)),
      'pers_nombre'     => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'pers_apellidos'  => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'pers_rut'        => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'pers_correo'     => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'pers_direccion'  => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'pers_fono_fijo'  => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'pers_fono_movil' => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'pers_user'       => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'pers_pass'       => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'pers_fech_ingre' => new sfValidatorDate(array('required' => false)),
      'pers_habilitado' => new sfValidatorInteger(array('required' => false)),
      'pers_tipo'       => new sfValidatorString(array('max_length' => 20, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('personal[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Personal';
  }

}
